﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using System.Web.SessionState;

namespace DTOWS.Controllers
{
    [HandleError]
    public class DebatController : Controller
    {
        public ActionResult Index()
        {
            ViewData["Message"] = "Min super seje debat!";
            ViewData["BodyID"] = "ForumSite";
            ViewData["BodyClass"] = "StuffSite";



            Session.Timeout = 1;


           

            ViewData["UserName"] = (string)Session["UserName"];
            

            

            return View();
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Index(string Name)
        {


            FormsAuthentication.SetAuthCookie(Name, true);

            Session["UserName"] = Name;


            return RedirectToAction("Index", "Debat");
        }

    }
}
